const http = require("http");
const fs = require("fs");
const path = require("path");
let filePath = '';
let fileName = process.argv[2];
if (!fileName) {
    filePath = path.join(__dirname, 'fileReader3.js');
} else {
    filePath = path.join(__dirname, fileName);
}
http.createServer((req, res) => {
    let reader = fs.createReadStream(filePath);
    reader.pipe(res);
}).listen(8081);